Skip to content

on-the-fly rotation tracker following ParticlesMC architecture#78

Merged
V-Francois merged 17 commits into
TheDisorderedOrganization:mainfrom
cyfraysse:feature/rotation
Jun 2, 2026
Merged

on-the-fly rotation tracker following ParticlesMC architecture#78
V-Francois merged 17 commits into
TheDisorderedOrganization:mainfrom
cyfraysse:feature/rotation

Conversation

@cyfraysse

@cyfraysse cyfraysse commented May 29, 2026

Copy link
Copy Markdown
Contributor

Two new algorithms

1- ComputeRotation —> [[simulation.observable]]

  • Updates system.phi at every compute step
  • Handles three methods via theta_T convention:
    • 0.0 → Integral (relay every step)
    • π → Euler (compare to initial frame)
    • any other value → Threshold (relay when rotation exceeds theta_T)
  • Internal state (R0, R_ref, phi_acc) kept in RotationState, one per chain

2- StorePhiTrajectories —> [[simulation.output]]

  • Reads system.phi and writes to disk on its scheduler
  • One file per theta_T per chain: chains/1/phitrajectories_k.dat

Key design decisions

  • system.phi added to Molecules struct right after position — rotation vectors live on the system like positions
  • New [[simulation.observable]] TOML section for non-output algorithms
  • Parallelizes across chains using Transducers.Map, following the same pattern as Arianna's Metropolis algorithm

TOML usage

[[simulation.observable]]
algorithm = "ComputeRotation"
scheduler_params = {linear_interval = 1}
parameters = {theta_T = [0.0, 0.7854, 3.1416]}

[[simulation.output]]
algorithm = "StorePhiTrajectories"
scheduler_params = {linear_interval = 1, log_base = 2.0}

Note: depends on TheDisorderedOrganization/Arianna.jl#87

@cyfraysse cyfraysse requested a review from a team as a code owner May 29, 2026 09:00
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.53488% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ParticlesMC.jl 0.00% 17 Missing ⚠️
src/rotation.jl 99.34% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/molecules.jl 69.89% <100.00%> (+0.32%) ⬆️
src/rotation.jl 99.34% <99.34%> (ø)
src/ParticlesMC.jl 7.31% <0.00%> (-1.18%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@romainljsimon romainljsimon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this version a lot, thanks @cyfraysse for the nice PR!
Let's wait for the StoreLastPhiFrame method before merging the PR :)

@romainljsimon

Copy link
Copy Markdown
Member

I was also thinking we could change the phi variable to Φ !

@V-Francois V-Francois left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, I just have a few minor comments.

Could you maybe add a test in the test folder that runs this? Just to have an end-to-end working case.

Comment thread src/rotation.jl Outdated
Comment thread src/rotation.jl Outdated
Comment thread src/rotation.jl
@cyfraysse

Copy link
Copy Markdown
Contributor Author

I've added the StoreLastPhiFrame, corrected the few remarks you both did and added a little test on the different rotation algorithms

@V-Francois V-Francois merged commit 257300f into TheDisorderedOrganization:main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants